home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 1
/
LIGHT-ROM 1 (Amiga Library Services)(1994).iso
/
ffdisks
/
d883.lha
/
BBBBS
/
BBDoors58.lha
/
rexxDoors
/
StoryBoard.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-01-27
|
5KB
|
219 lines
/* Story Writer 1.0 by Nathan Beaty */
signal on syntax
signal on ioerr
signal on BREAK_C
/* Open the support library if it is not already open. */
if ~show('L',"rexxsupport.library") then do
if ~addlib('rexxsupport.library',0,-30,0) then do
CALL TRANSMIT 'Support library not available. Aborting...'
call CloseShop
exit 10
end
end
figarg='s:CONFIG.BBS'
IF ~EXISTS(figarg) THEN figarg='BBS:BBS_TEXT/CONFIG.BBS'
x=OPEN(f,figarg,'R')
IF x=0 THEN
DO
SAY 's:CONFIG.BBS and BBS:BBS/CONFIG.BBS are both missing!'
EXIT(20)
END
line=STRIP(READLN(f))
sysop=WORD(READLN(f),1)
CALL CLOSE(f)
compos=POS('/*',line)
IF compos>0 THEN line=LEFT(line,compos-1)
BBSNAME=STRIP(line)
bbspath=GETCLIP('BBS_path')
PARSE ARG name . . gfx
CALL MAKEDIR(bbspath'rexxDoors/Data/StoryBoard')
DATFILE1 = bbspath'rexxDoors/Data/StoryBoard/story1'
DATFILE2 = bbspath'rexxDoors/Data/StoryBoard/story2'
DATFILE3 = bbspath'rexxDoors/Data/StoryBoard/story3'
MFILE1 = 'Story 1 - unnamed'
MFILE2 = 'Story 2 - unnamed'
MFILE3 = 'Story 3 - unnamed'
DATFILE = DATFILE1
MFILE = MFILE1
CLS = ''
if (gfx) then do
OFF = ''
RED = '
'
YEL = '
'
BLU = '
'
REDWHT = '
'
WHTBLU = '
'
end
else do
OFF = ''
RED = ''
YEL = ''
BLU = ''
REDWHT = ''
WHTBLU = ''
end
BEGIN:
CALL TRANSMIT CLS
CALL TRANSMIT REDWHT'Story Board! By Nathan Beaty'
CALL TRANSMIT OFF '------------------------------'
CALL TRANSMIT BLU'You are currently in 'RED MFILE
CALL TRANSMIT ' '
CALL TRANSMIT WHTBLU'[1]'OFF BLU' - change to' MFILE1
CALL TRANSMIT WHTBLU'[2]'OFF BLU' - change to' MFILE2
CALL TRANSMIT WHTBLU'[3]'OFF BLU' - change to' MFILE3
CALL TRANSMIT ' '
CALL TRANSMIT WHTBLU'[A]'OFF BLU' - Add to' RED MFILE
CALL TRANSMIT WHTBLU'[V]'OFF BLU' - View ' RED MFILE
CALL TRANSMIT WHTBLU'[Q]uit'OFF BLU' - return to 'YEL||BBSNAME||OFF
CALL TRANSMIT ' '
OPTIONS PROMPT YEL 'Option: '
PULL opt
CALL TRANSMIT opt
select
when opt='1' then do
DATFILE = DATFILE1
MFILE = MFILE1
signal BEGIN
end
when opt='2' then do
DATFILE = DATFILE2
MFILE = MFILE2
signal BEGIN
end
when opt='3' then do
DATFILE = DATFILE3
MFILE = MFILE3
signal BEGIN
end
when opt='A' then do
call GETLINE
end
when opt='V' then do
CALL TRANSMIT cls
CALL TRANSMIT MFILE
CALL TRANSMIT '-----------------------------------------------------------'OFF
x=OPEN(f,DATFILE,'R')
IF x~=0 THEN
DO i=1
line=READLN(f)
IF EOF(f) THEN LEAVE i
CALL TRANSMIT line
END
CALL CLOSE(f)
OPTIONS PROMPT YEL'Press Return 'OFF
PULL junk
CALL TRANSMIT ''
signal BEGIN
end
when opt='Q' then do
CALL TRANSMIT ' '
CALL TRANSMIT 'Returning to 'BBSNAME
exit
end
otherwise signal BEGIN
end
signal BEGIN
GETLINE:
CALL TRANSMIT CLS
OPTIONS PROMPT 'Add how many lines? (1-5) >'
PULL LINEN
if LINEN < 1 or LINEN > 5 then call getline
CALL TRANSMIT '>-Enter 'LINEN' Lines - Return to Quit - .......................................|'
ADD = ''
line = ' '
do for LINEN until line=''
if NoCarrier() then call Die
OPTIONS PROMPT '>'
PARSE PULL line
ADD = STRIP(ADD line)
end
if ADD=='' then do
call BEGIN
end
lines = 0
do while length(ADD) > 79
pointer = 79
do for 79 while substr(ADD,pointer,1)~=' '
pointer = pointer - 1
end
lines = lines + 1
ADD.lines = left(ADD,pointer)
ADD = substr(ADD,pointer+1)
end
if length(ADD) > 0 then do
lines = lines + 1
ADD.lines = ADD
end
CALL TRANSMIT ' '
MAKESURE:
OPTIONS PROMPT 'Add lines to the story? (Y/n) :'
PULL choice
if choice = 'N' then call BEGIN
WRITELINE:
CALL TRANSMIT BLU" Yes!"OFF
CALL TRANSMIT "Adding to"MFILE"...."
IF EXISTS(DATFILE) THEN call open file, DATFILE,'A'
ELSE call open file, DATFILE,'W'
do i = 1 to lines
call writeln file,ADD.i
end
call close file
call BEGIN
CloseShop:
Die:
exit
return
NoCarrier:
IF ADDRESS()~='BAUD' THEN RETURN 0
dcd
carrier = RC
if carrier==0 then
rv = 1
else
rv = 0
return(rv)
/*************************************************************************/
IOERR:
CALL TRANSMIT '*BOOM* IO error in StoryBoard. PLEASE notify the sysop.'
CALL TRANSMIT 'Line:' SIGL
call CloseShop
exit
ERROR:
CALL TRANSMIT '*BOOM* Error in StoryBoard. PLEASE notify the sysop.'
CALL TRANSMIT 'Line:' SIGL ' Severity:' RC
call CloseShop
exit
SYNTAX:
CALL TRANSMIT '*BOOM* Syntax error in StoryBoard. PLEASE notify the sysop.'
BREAK_C:
CALL TRANSMIT 'Line:' SIGL ' Error Code:' RC
call CloseShop
exit
transmit:
PARSE ARG string
SAY string'0D'x
RETURN
/*************************************************************************/